package Test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ArrayList;

import Test.tools.Condatabase;

public class GeneratorConfig {

	static String currentBao = "cn.com.myshiro";
	static String programName = "myshiro";
	private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
	private static final String DATABASE_URL = "jdbc:mysql://localhost:3306/auth?useUnicode=true";
	private static final String DATABASE_USER = "root";
	private static final String DATABASE_PASSWORD = "1234";
	
	//以上信息需要修改
	
	private static Connection con = null;

	public static Connection getConnection() {
		try {
			Class.forName(DRIVER_CLASS);
			con = DriverManager.getConnection(DATABASE_URL, DATABASE_USER, DATABASE_PASSWORD);
			return con;
		} catch (Exception ex) {
			System.out.println("message :" + ex.getMessage());
		}
		return con;
	}

	static ArrayList<Object> er = Condatabase.getTableNameByCon(GeneratorConfig.getConnection());
	static String[] str = (String[]) er.toArray(new String[er.size()]);
	static String tb[] = str;

	public static void main(String[] args) {
		Connection coon = Condatabase.getConnection();
		ArrayList<Object> er = Condatabase.getTableNameByCon(coon);
		String[] str = (String[]) er.toArray(new String[er.size()]);
		System.out.println(str.length);

	}

}
